/*
 * @Author: 大D
 * @email: 857216393@qq.com
 * @Date: 2024-01-31 10:41:02
 * @Description: 获取用户ip 地理位置信息 并全局注入
 */
import { getIp } from '@/apis/ip';
import type { App } from 'vue';
export const getIpFun = async (app: App<Element>) => {
  const res = await getIp();
  const info = { ip: res.data.ip, ip_address: res.data.ip_address };
  sessionStorage.setItem('ipInfo', JSON.stringify(info));
  app.provide('ipInfo', info);
};
